home *** CD-ROM | disk | FTP | other *** search
- unit clFoo;
- interface
- Uses SysUtils;
- Type
- TCaptionType = (ctNormal,ctAbbrev,ctUpper,ctCapital);
- TFoo = class
- protected
- function GetCaption(const value: string; opt: TCaptionType): string;
- public
- property Caption[const value: string; opt: TCaptionType]: string read GetCaption;
- end;
- var Foo: TFoo;
- implementation
- function TFoo.GetCaption(const value: string; opt: TCaptionType): string;
- begin
- if value='' then Result := ''
- else begin
- case opt of
- ctNormal: Result := value;
- ctAbbrev: Result := Copy(value,1,8);
- ctUpper: Result := Uppercase(value);
- ctCapital: Result := UpCase(value[1])+Copy(value,2,255);
- end;
- end;
- end;
- initialization
- Foo := TFoo.Create;
- finalization
- Foo.Free;
- end.